﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:s="http://schemas.microsoft.com/surface/2008"
                    xmlns:controls="clr-namespace:Black.SurfaceToolkit.Controls">

    <Style TargetType="{x:Type controls:SurfaceExpander}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:SurfaceExpander}">
                    <Border SnapsToDevicePixels="True"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid Background="{TemplateBinding Background}"
                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="30" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <StackPanel Grid.Row="0"
                                        Grid.Column="0"
                                        Orientation="Horizontal"
                                        Background="{TemplateBinding HeaderBackground}">
                                <Image x:Name="PART_ctlTouch" RenderTransformOrigin="0.5,0.5"
                                       Margin="5,0,0,0" Width="25" Height="25" Stretch="Uniform"
                                       Source="pack://application:,,,/Black.SurfaceToolkit;component/Assets/Finger.png" />
                                <TextBlock Text="{TemplateBinding Header}" Grid.Row="0" Grid.Column="1"
                                           Foreground="Black" FontWeight="Bold" Margin="5,0,0,0"
                                           HorizontalAlignment="Left" VerticalAlignment="Center" />
                            </StackPanel>

                            <ContentPresenter x:Name="PART_cpMain" Grid.Column="0" Grid.Row="1"
                                              Visibility="{TemplateBinding VisibilityExpand}"
                                              HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>